<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        div {
            display: flex;
            /* 默认主轴为X轴 row */
            flex-direction: row;
            /* justify-content：设置主轴元素对齐方式 
                flex-start      默认 
                flex-end        在主轴末尾
                center          在主轴中间
                space-around    平分剩余空间
                space-between   左右靠边中间平分(重要)
            */
            justify-content: space-between;
            width: 800px;
            height: 300px;
            background-color: pink;
        }

        span {
            width: 150px;
            height: 100px;
            background-color: skyblue;
        }
    </style>

</head>
<body>
    
    <img src="../flex-设置主轴元素排列方式.png" alt="">
    <br>

    <div>
        <span>1</span>
        <span>2</span>
        <span>3</span>
        <span>4</span>
    </div>

</body>
</html>